<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="业务单反完工" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/css/BillList.css" />
<script src="/js/QueryList.js"></script>
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function doJump(pageIndex){
		if(window.event.keyCode==13){
			doGo(pageIndex);
		}
	}
	function doCancel(){
		window.close();
	}
	function doInit(){
		//Window_Onload();
	}
	function checkDateStr(){
		var startDate=document.getElementById("start_date").value;
		if(startDate==null || startDate==''){
			ShowAlert('提示框','请选择订货开始日期',200,100);
			return false;
		}else{
			var arr=startDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','订货开始日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','订货开始日期格式不正确',200,100);
				return false;
			}
		}
		var endDate=document.getElementById("end_date").value;
		if(endDate==null || endDate==''){
			ShowAlert('提示框','请选择订货结束日期',200,100);
			return false;
		}else{
			var arr=endDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','订货结束日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','订货结束日期格式不正确',200,100);
				return false;
			}
		}
		return true;
	}
	function checkDelDateStr(){
		var startDate=document.getElementById("del_start").value;
		if(startDate==null || startDate==''){
			ShowAlert('提示框','请选择交货开始日期',200,100);
			return false;
		}else{
			var arr=startDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','交货开始日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','交货开始日期格式不正确',200,100);
				return false;
			}
		}
		var endDate=document.getElementById("del_end").value;
		if(endDate==null || endDate==''){
			ShowAlert('提示框','请选择交货结束日期',200,100);
			return false;
		}else{
			var arr=endDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','交货结束日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','交货结束日期格式不正确',200,100);
				return false;
			}
		}
		return true;
	}
	function createPageParaStr(){
		var str="start_date="+encodeURIComponent(document.getElementById("start_date").value);
		str=str+"&end_date="+encodeURIComponent(document.getElementById("end_date").value);
		str=str+"&del_start="+encodeURIComponent(document.getElementById("del_start").value);
		str=str+"&del_end="+encodeURIComponent(document.getElementById("del_end").value);
		str=str+"&est_name="+encodeURIComponent(document.getElementById("est_name").value);
		str=str+"&bill_code="+encodeURIComponent(document.getElementById("bill_code").value);
		str=str+"&content="+encodeURIComponent(document.getElementById("content").value);
		str=str+"&mng_name="+encodeURIComponent(document.getElementById("mng_name").value);
		str=str+"&foll_name="+encodeURIComponent(document.getElementById("foll_name").value);
		str=str+"&wc_id="+document.getElementById("wc_id").value;
		str=str+"&ts_id="+document.getElementById("ts_id").value;
		str=str+"&order_by="+document.getElementById("order_by").value;
		str=str+"&order_sc="+document.getElementById("order_sc").value;
		
		return str;
	}
	
	function createProgramParaStr(){
		var str="start_date="+encodeURIComponent(document.getElementById("hid_start_date").value);
		str=str+"&end_date="+encodeURIComponent(document.getElementById("hid_end_date").value);
		str=str+"&del_start="+encodeURIComponent(document.getElementById("hid_del_start").value);
		str=str+"&del_end="+encodeURIComponent(document.getElementById("hid_del_end").value);
		str=str+"&est_name="+encodeURIComponent(document.getElementById("hid_est_name").value);
		str=str+"&bill_code="+encodeURIComponent(document.getElementById("hid_bill_code").value);
		str=str+"&content="+encodeURIComponent(document.getElementById("hid_content").value);
		str=str+"&mng_name="+encodeURIComponent(document.getElementById("hid_mng_name").value);
		str=str+"&foll_name="+encodeURIComponent(document.getElementById("hid_foll_name").value);
		str=str+"&wc_id=${wcId}";
		str=str+"&ts_id=${tsId}";
		str=str+"&order_by=${orderBy}";
		str=str+"&order_sc=${orderSc}";
		
		return str;
	}
	function doSearch(){
		var str;
		if(IsAdvSearch){//高级
			str="search_type=1";
			if(document.getElementById("cb_bill_code").checked){
				var billCode=document.getElementById("bill_code").value.trim();
				if(billCode==null || billCode==""){
					ShowAlert('提示框','请输入业务单号',200,100);
					return;
				}
				str=str+"&cb_bill_code=1";
			}
			if(document.getElementById("cb_order_date").checked){
				if(checkDateStr()){
					str=str+"&cb_order_date=1";
				}else{
					return;
				}
			}
			if(document.getElementById("cb_del_date").checked){
				if(checkDelDateStr()){
					str=str+"&cb_del_date=1";
				}else{
					return;
				}
			}
			if(document.getElementById("cb_est").checked){
				var estName=document.getElementById("est_name").value.trim();
				if(estName==null || estName==""){
					ShowAlert('提示框','请输入订货单位',200,100);
					return;
				}
				str=str+"&cb_est=1";
			}
			if(document.getElementById("cb_wc").checked){
				var wcId=document.getElementById("wc_id").value;
				if(wcId==null || wcId=="" || wcId=="0"){
					ShowAlert('提示框','请选择工作中心',200,100);
					return;
				}
				str=str+"&cb_wc=1";
			}
			if(document.getElementById("cb_content").checked){
				var content=document.getElementById("content").value.trim();
				if(content==null || content==""){
					ShowAlert('提示框','请输入摘要',200,100);
					return;
				}
				str=str+"&cb_content=1";
			}
			if(document.getElementById("cb_mng").checked){
				var mngName=document.getElementById("mng_name").value.trim();
				if(mngName==null || mngName==""){
					ShowAlert('提示框','请输入业务员姓名',200,100);
					return;
				}
				str=str+"&cb_mng=1";
			}
			if(document.getElementById("cb_foll").checked){
				var follName=document.getElementById("foll_name").value.trim();
				if(follName==null || follName==""){
					ShowAlert('提示框','请输入跟单员姓名',200,100);
					return;
				}
				str=str+"&cb_foll=1";
			}
			if(document.getElementById("cb_ts").checked){
				var tsId=document.getElementById("ts_id").value;
				if(tsId==null || tsId=="" || tsId=="0"){
					ShowAlert('提示框','请选择帐套',200,100);
					return;
				}
				str=str+"&cb_ts=1";
			}
			if(document.getElementById("cb_order").checked){
				var orderBy=document.getElementById("order_by").value;
				if(orderBy==null || orderBy==""){
					ShowAlert('提示框','请选择排序类型',200,100);
					return;
				}
				str=str+"&cb_order=1";
			}
		}else{//快速
			str="search_type=2";
			if(!checkDateStr()){
				return;
			}
		}
		var paraStr=createPageParaStr();
		if(paraStr!=""){
			str=str+"&"+paraStr;
		}
		window.location="/business/BusinessBillListForUnComplete.ihtm?"+str;
	}
	function doGo(pageIndex){
		var str=getSearchCondition();
		str=str+"&current_page="+pageIndex;
		window.location="/business/BusinessBillListForUnComplete.ihtm?"+str;
	}
	function getSearchCondition(){
		var searchType="${searchType}";
		var str="search_type="+searchType;
		if(searchType=="1"){//高级
			<c:if test="${cbOrderDate=='1'}">str=str+"&cb_order_date=1";</c:if>
			<c:if test="${cbDelDate=='1'}">str=str+"&cb_del_date=1";</c:if>
			<c:if test="${cbEst=='1'}">str=str+"&cb_est=1";</c:if>
			<c:if test="${cbBillCode=='1'}">str=str+"&cb_bill_code=1";</c:if>
			<c:if test="${cbContent=='1'}">str=str+"&cb_content=1";</c:if>
			<c:if test="${cbMng=='1'}">str=str+"&cb_mng=1";</c:if>
			<c:if test="${cbFoll=='1'}">str=str+"&cb_foll=1";</c:if>
			<c:if test="${cbWc=='1'}">str=str+"&cb_wc=1";</c:if>
			<c:if test="${cbTs=='1'}">str=str+"&cb_ts=1";</c:if>
			<c:if test="${cbOrder=='1'}">str=str+"&cb_order=1";</c:if>
		}else{//快速
			
		}
		var paraStr=createProgramParaStr();
		if(paraStr!=""){
			str=str+"&"+paraStr;
		}
		return str;
	}
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var id="",wcId="";
		if(ob_arr.length>=it.getAttribute("index")){
			id=ob_arr[it.getAttribute("index")-1].value;
			wcId=ob_arr[it.getAttribute("index")-1].getAttribute("wcId");
		}
		if(id==""){
			return;
		}
		doShow(id,wcId);
	}
	function doAutoCheck(objId){
		if(document.getElementById(objId).style.visibility!="hidden"){
			document.getElementById(objId).checked=true;
		}
	}
	function doShow(id,wcId){
		var url="/business/BusinessBillInfoForUnComplete.ihtm?id="+id+"&wc_id="+wcId;
		ShowIframe("业务单反完工",url,900,500,"refreshWin()",900,600);
	}
	function refreshWin(){
		if(popRetVal!=null){
			window.location=window.location;
		}
	}
	function selectStafferName(objId,checkObjId){
		var url="/base/StafferMainForSelect.ihtm";
		ShowIframe("选择员工",url,800,500,"selectStafferNameCallBack('"+objId+"','"+checkObjId+"')");
	}
	function selectStafferNameCallBack(objId,checkObjId){
		if(popRetVal!=null){
			var arr=popRetVal.split(";");
			document.getElementById(objId).value=arr[1];
			doAutoCheck(checkObjId);
		}
	}
	function checkInput(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
	function setDate(type){
		var d=new Date();
		var startStr="";
		var endStr="";
		if(type=="CURRENT_MONTH"){
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-01";
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="PREVIEW_MONTH"){
			d=new Date(d.getFullYear(),d.getMonth(),1);
			d.setDate(d.getDate()-1);
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-1";
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="TODAY"){
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="YESTERDAY"){
			d.setDate(d.getDate()-1);
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}
		document.getElementById("start_date").value=startStr;
		document.getElementById("end_date").value=endStr;
		doAutoCheck("cb_order_date");
	}
	function selectEstName(){
		var url="/base/EstablishmentListForSelect.ihtm?type=CLIENT";
		ShowIframe("选择客户",url,900,500,"selectEstNameCallBack()",900,600);
	}
	function selectEstNameCallBack(){
		if(popRetVal!=null){
			document.getElementById("est_name").value=popRetVal[1];
			doAutoCheck("cb_est");
		}
	}
</script>
</head>
<body oncontextmenu="return false">
<div class="Wrap"><!-- 页面主框架 -->
    
	<div id="ListContainer" class="Container"><!-- 主体容器 -->
	    
	    <!-- 标题栏 -->
	    <div class="Heading BillIcon">
	        <div class="HeadingContent">
	            <h1>业务单反完工</h1>
	            <span class="Note">将业务单项目恢复为未完工状态</span>
	        </div>
	    </div>
	
		<!-- 主内容 -->
		<div class="Content">
	        <!-- 筛选控件栏 -->
	        <div class="FilterBar ClearFix">
	            <div class="SearchIcon"></div>
	            <span class="fl">
	            	<table class="MoreOption" cellpadding="0" cellspacing="0">
	            		<th width="80px">
	            			<input type="checkbox" name="cb_order_date" id="cb_order_date" <c:if test="${cbOrderDate=='1' || searchType=='2'}">checked="true"</c:if> style="visibility:hidden;" />
	            			订货日期
	            		</th>
	            		<td width="360px">
	            			<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_order_date');" id="start_date" name="start_date" value="<c:out value="${startDate}" />">
			            	<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('start_date'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_order_date\')');">
			            	<input type="hidden" id="hid_start_date" value="<c:out value="${startDate}" />">
			            	至
			            	<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_order_date');" id="end_date" name="end_date" value="<c:out value="${endDate}" />">
			            	<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('end_date'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_order_date\')');">
			            	<input type="hidden" id="hid_end_date" value="<c:out value="${endDate}" />">
			            	<a href="javascript:setDate('CURRENT_MONTH');">本月</a>
							<a href="javascript:setDate('TODAY');">今天</a>
							<a href="javascript:setDate('YESTERDAY');">昨天</a>
							<a href="javascript:setDate('PREVIEW_MONTH');">上月</a>
	            		</td>
	            	</table>
	            </span>
				<span class="fr">
	            	<a href="javascript:;" id="lnkMoreOption">更多查询选项</a>
				  	<input type="button" value=" 查 询" onClick="doSearch();" class="buttom search-but" id="sSearchButton" name="sSearchButton">
	            </span>
				<div id="dvMoreOptionBox" class="MoreOptionBox" style="display:none;">
					<table class="MoreOption" cellpadding="0" cellspacing="0">
						<tr>
							<th class="c1" width="80px">
			        			<input name="" type="checkbox" name="cb_del_date" id="cb_del_date" <c:if test="${cbDelDate=='1'}">checked="true"</c:if>>
			    				交货日期
			        		</th>
			    			<td width="260px">
			        			<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_del_date');" id="del_start" name="del_start" value="<c:out value="${delStart}" />" >
								<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('del_start'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_del_date\')');">
								<input type="hidden" id="hid_del_start" value="<c:out value="${delStart}" />">
					            	至
								<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_del_date');" id="del_end" name="del_end" value="<c:out value="${delEnd}" />" >
								<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('del_end'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_del_date\')');">
								<input type="hidden" id="hid_del_end" value="<c:out value="${delEnd}" />">
			    			</td>
			    			<th class="c2" width="80px">
			    				<input type="checkbox" name="cb_mng" id="cb_mng" <c:if test="${cbMng=='1'}">checked="true"</c:if>>
			    				业务员
			    			</th>
			    			<td class="c3" width="250px">
			    				<input type="text" class="TextBox" maxlength="15" name="mng_name" id="mng_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_mng');" value="<c:out value="${mngName}" />" >
								<img class="imgIconButton" src="/images/make-a.gif" onClick="selectStafferName('mng_name','cb_mng');" />
								<input type="hidden" id="hid_mng_name" value="<c:out value="${mngName}" />">
			    			</td>
			    		</tr>
						<tr>
			    			<th class="c1">
			    				<input type="checkbox" name="cb_bill_code" id="cb_bill_code" <c:if test="${cbBillCode=='1'}">checked="true"</c:if>>
			        			业务单号
			    			</th>
			    			<td class="c1">
			    				<input type="text" class="TextBox" maxlength="50" name="bill_code" id="bill_code" onFocus="doAutoCheck('cb_bill_code');" onKeyUp="checkInput();" value="<c:out value="${billCode}" />">
								<input type="hidden" id="hid_bill_code" value="<c:out value="${billCode}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_foll" id="cb_foll" <c:if test="${cbFoll=='1'}">checked="true"</c:if>>
			        			跟单员
			        		</th>
			    			<td class="c3">
			        			<input type="text" class="TextBox" maxlength="15" name="foll_name" id="foll_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_foll');" value="<c:out value="${follName}" />" >
	                        	<img src="/images/make-a.gif" class="imgIconButton" onClick="selectStafferName('foll_name','cb_foll');" />
	                        	<input type="hidden" id="hid_foll_name" value="<c:out value="${follName}" />">
			    			</td>
			    		</tr>
						<tr>
			    			<th class="c1">
			    				<input type="checkbox" name="cb_est" id="cb_est" <c:if test="${cbEst=='1'}">checked="true"</c:if>>
			    				订货单位
			    			</th>
			    			<td class="c1">
			    				<input type="text" class="TextBox" maxlength="50" name="est_name" id="est_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_est');" value="<c:out value="${estName}" />" >
								<img class="imgIconButton" src="/images/make-a.gif" onClick="selectEstName();" />
								<input type="hidden" id="hid_est_name" value="<c:out value="${estName}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_wc" id="cb_wc" <c:if test="${cbWc=='1'}">checked="true"</c:if>>
			        			工作中心
			        		</th>
	                    	<td class="c3">
	                    		<select name="wc_id" id="wc_id" onFocus="doAutoCheck('cb_wc');" onChange="doWcIdChange();">
					  				<option value="0">==请选择==</option>
					  				<c:forEach var="item" items="${wcList}">
					  				<option value="${item.id}" <c:if test="${wcId==item.id}">selected</c:if>>${item.wcName}</option>
					  				</c:forEach>
								</select>
	                    	</td>
			    		</tr>
			    		<tr>
			    			<th class="c1">
			    				<input type="checkbox" name="cb_content" id="cb_content" <c:if test="${cbContent=='1'}">checked="true"</c:if>>
			    				摘要
			    			</th>
			    			<td class="c1">
			    				<input type="text" class="TextBox" maxlength="50" name="content" id="content" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_content');" value="${content}" >
								<input type="hidden" id="hid_content" value="<c:out value="${content}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_ts" id="cb_ts" <c:if test="${cbTs=='1'}">checked="true"</c:if>>
	                        	账套
			        		</th>
			    			<td class="c3">
			        			<select name="ts_id" id="ts_id" onFocus="doAutoCheck('cb_ts');">
				    				<option value="0">==请选择账套==</option>
				    				<c:forEach var="item" items="${tsList}">
									<option value="${item.id}" <c:if test="${tsId==item.id}">selected</c:if>>${item.title}</option></c:forEach>
								</select>
			        		</td>
			    		</tr>
					</table>
					<div class="OptionOrderBy">
	                	<input type="checkbox" name="cb_order" id="cb_order" <c:if test="${cbOrder=='1'}">checked="true"</c:if>>
	                    	排序类型
	                    <select name="order_by" id="order_by" onFocus="doAutoCheck('cb_order');">
	                        <option value="">==请选择==</option>
					  		<option value="ORDER_DATE" <c:if test="${orderBy=='ORDER_DATE'}">selected</c:if>>订货日期</option>
					  		<option value="DELIVER_DATE" <c:if test="${orderBy=='DELIVER_DATE'}">selected</c:if>>交货日期</option>
					  		<option value="BILL_CODE" <c:if test="${orderBy=='BILL_CODE'}">selected</c:if>>业务单号</option>
	                    </select>
	                    <select name="order_sc" id="order_sc" onFocus="doAutoCheck('cb_order');">
	                        <option value="ASC" <c:if test="${orderSc=='ASC'}">selected</c:if>>升序</option>
	                        <option value="DESC" <c:if test="${orderSc=='DESC'}">selected</c:if>>降序</option>
	                    </select>
	                    <span class="fr"><a href="javascript:;" id="lnkHiddenOption">隐藏查询选项</a></span>
	                </div>
				</div>
			</div>
			
			<!-- 提示信息显示栏 -->
	        <div class="MsgBar">
	            <%@include file="../inc/AlertMsg.jsp"%>
	        </div>

		  	<div class="table-list">
		        <table width="100%">      
					<tr >
						<th width="14%">单号</th>
						<th width="10%">订货日期</th>
						<th width="18%">订货单位</th>
						<th width="16%">摘要</th>
						<th width="10%">交货日期</th>
						<th width="16%">跟单员</th>
						<th width="10%">工作中心</td>
						<th width="6%">操作</th>
					</tr>
					<c:forEach var="item" items="${qr.list}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' onClick='javascript:ClickCheck(this)' ondblclick='javascript:DoubleClick(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
						<td>
							${item[0].billCode}
							<input type="radio" name='query_checkbox' value="${item[0].id}" wcId="${item[2]}" style="display:none">
						</td>
						<td><fmt:formatDate value="${item[0].orderDate}" pattern="yyyy-MM-dd"/></td>
						<td><c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';NO_CLIE_NAME;')==-1}">${item[1]}</c:if></td>
						<td>${item[0].content}</td>
						<td>
							<c:if test="${item[0].deliverDate!=null}">
							<fmt:formatDate value="${item[0].deliverDate}" pattern="yyyy-MM-dd"/>
							</c:if>
						</td>
						<td>${item[0].followerNameStr}</td>
						<td><commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item[2]}" /></td>
						<td>
							<a href="javascript:doShow('${item[0].id}','${item[2]}');">查看</a>
						</td>
					</tr>
					</c:forEach>
				</table>
			</div>
			
			<!-- 底栏 分页、操作等 -->
	        <div class="BottomToolBar ClearFix">
			    <%@include file="../inc/Pages.jsp"%>
	        </div>
		</div>
	</div>

</div>
</body>
</html>
<script type="text/javascript">
	function ChangeWindowSize( container, maxWidth ){
	    setTimeout( function(){
	        var w1 = document.documentElement.clientWidth-40;
	        if( w1>maxWidth ) w1 = maxWidth;
	        else if( w1<870 ) w1 = 860;
	        container.style.width = w1+'px';
	    }, 300 );
	}
	var IsAdvSearch = false;
	(function(){
		doInit();
	    var ListContainer = document.getElementById('ListContainer');
	    ChangeWindowSize( ListContainer, 2020 );    // 超过 1280 的最大 1260 ，不全部铺满
	
	    var lnkMoreOption   = document.getElementById('lnkMoreOption');
	    var lnkHiddenOption = document.getElementById('lnkHiddenOption');
	    lnkMoreOption.onclick = function(){
	    	IsAdvSearch = true;
	        document.getElementById('dvMoreOptionBox').style.display = 'block';
	        document.getElementById('cb_order_date').style.visibility = 'visible';
	        this.style.visibility = 'hidden';
	    };
	    lnkHiddenOption.onclick = function(){
	    	IsAdvSearch = false;
	        document.getElementById('dvMoreOptionBox').style.display = 'none';
	        document.getElementById('cb_order_date').style.visibility = 'hidden';
	        lnkMoreOption.style.visibility = 'visible';
	    };
	})();
</script>
